package ModelImplementation

import "time"

type BiweeklySchedule struct {
}

func (bs* BiweeklySchedule)IsPayDate(payDate time.Time) bool {
	firstPayableFriday := time.Date(2001,11,9,0,0,0,0,time.Local)
	ts := payDate.Sub(firstPayableFriday)
	daysSinceFirstPayableFriday := ts.Hours()
	days := int(daysSinceFirstPayableFriday / 24)
	return days%14 == 0
}

func GetPayPeriodStartDate(payPeriodEndDate time.Time) time.Time {
	return payPeriodEndDate.AddDate(0,0,-13)
}
